package wickethub.domain;

import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Lob;

@Entity
public class Component extends Resource {

	public enum License {
		apache2, cddl, gpl2, gpl3, lgpl, bsd, mit, other
	}

	@Lob private String websiteUrl;
	@Lob private String examplesUrl;
	@Lob private String jarUrl;
	@Enumerated(EnumType.STRING) private License license;
	
	public String getWebsiteUrl() {
		return websiteUrl;
	}
	
	public void setWebsiteUrl(String websiteUrl) {
		this.websiteUrl = websiteUrl;
	}
	
	public String getExamplesUrl() {
		return examplesUrl;
	}

	public void setExamplesUrl(String examplesUrl) {
		this.examplesUrl = examplesUrl;
	}

	public String getJarUrl() {
		return jarUrl;
	}
	
	public void setJarUrl(String jarUrl) {
		this.jarUrl = jarUrl;
	}
	
	public License getLicense() {
		return license;
	}
	
	public void setLicense(License license) {
		this.license = license;
	}
	
	@Override
	public boolean equals(Object obj) {
		if (obj == null || !(obj instanceof Component)) {
			return false;
		}
		return ((Component)obj).getId().equals(this.getId());
	}
	
}